package com.yanqu.road.server.manger.activity.qixi.service;

import com.google.protobuf.InvalidProtocolBufferException;
import com.yanqu.road.pb.activity.QixiProto;
import com.yanqu.road.pb.syncMessage.SyncMessage;
import com.yanqu.road.server.game.service.IGameServiceCommand;
import com.yanqu.road.server.manger.player.GamePlayerMgr;
import com.yanqu.road.server.protocol.ClientProtocol;
import com.yanqu.road.sync.message.SyncResponse;
import com.yanqu.road.utils.YanQuMessageUtils;

public class QixiGetMostGiftTargetUserBackServiceCmd implements IGameServiceCommand {
    @Override
    public SyncResponse execute(SyncMessage.Request request) throws InvalidProtocolBufferException {
        SyncResponse syncResponse = new SyncResponse();
        QixiProto.QixiGetMostGiftTargetUserRespMsg resultMsg = QixiProto.QixiGetMostGiftTargetUserRespMsg.parseFrom(request.getDataBytes());

        GamePlayerMgr.sendPacket(request.getSenderId(), YanQuMessageUtils.buildMessage(ClientProtocol.U_QIXI_GET_MOST_GIFT_TARGET_USER, resultMsg));

        return syncResponse;
    }
}
